# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
# Originally from the AUR.

pkgname=perl-io-socket-ip
_pkgname=IO-Socket-IP
pkgver=0.41
pkgrel=5
pkgdesc='Family-neutral IP socket supporting both IPv4 and IPv6.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=0')
makedepends=('perl-module-build')
url='http://search.cpan.org/dist/IO-Socket-IP'
source=("http://search.cpan.org/CPAN/authors/id/P/PE/PEVANS/$_pkgname-$pkgver.tar.gz")
sha512sums=('f9fed6684ccaae3dcc1429d61211a24c2714af390b04a29e5a1362cfd470efc79305d3cb927d4caeb9e85302f248b2989e18332f8bef8022b427a49807f493fd')

build() {
  cd "$_pkgname-$pkgver"

  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    /usr/bin/perl Build.PL

    ./Build
  )
}

package() {
  cd "$_pkgname-$pkgver"

  ./Build install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

